3.107 \(\int \frac{(a+b \tan ^{-1}(c x))^2}{(d+i c d x)^2} \, dx\)

Optimal. Leaf size=122 \[ \frac{i b \left (a+b \tan ^{-1}(c x)\right )}{c d^2 (-c x+i)}+\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{c d^2 (1+i c x)}-\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d^2}+\frac{b^2}{2 c d^2 (-c x+i)}-\frac{b^2 \tan ^{-1}(c x)}{2 c d^2} \]

[Out]

b^2/(2*c*d^2*(I - c*x)) - (b^2*ArcTan[c*x])/(2*c*d^2) + (I*b*(a + b*ArcTan[c*x]))/(c*d^2*(I - c*x)) - ((I/2)*(
a + b*ArcTan[c*x])^2)/(c*d^2) + (I*(a + b*ArcTan[c*x])^2)/(c*d^2*(1 + I*c*x))

________________________________________________________________________________________

Rubi [A]  time = 0.121582, antiderivative size = 122, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.273, Rules used = {4864, 4862, 627, 44, 203, 4884} \[ \frac{i b \left (a+b \tan ^{-1}(c x)\right )}{c d^2 (-c x+i)}+\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{c d^2 (1+i c x)}-\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d^2}+\frac{b^2}{2 c d^2 (-c x+i)}-\frac{b^2 \tan ^{-1}(c x)}{2 c d^2} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*ArcTan[c*x])^2/(d + I*c*d*x)^2,x]

[Out]

b^2/(2*c*d^2*(I - c*x)) - (b^2*ArcTan[c*x])/(2*c*d^2) + (I*b*(a + b*ArcTan[c*x]))/(c*d^2*(I - c*x)) - ((I/2)*(
a + b*ArcTan[c*x])^2)/(c*d^2) + (I*(a + b*ArcTan[c*x])^2)/(c*d^2*(1 + I*c*x))

Rule 4864

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_)*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Simp[((d + e*x)^(q + 1)*(a
 + b*ArcTan[c*x])^p)/(e*(q + 1)), x] - Dist[(b*c*p)/(e*(q + 1)), Int[ExpandIntegrand[(a + b*ArcTan[c*x])^(p -
1), (d + e*x)^(q + 1)/(1 + c^2*x^2), x], x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 1] && IntegerQ[q] && N
eQ[q, -1]

Rule 4862

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Simp[((d + e*x)^(q + 1)*(a + b*
ArcTan[c*x]))/(e*(q + 1)), x] - Dist[(b*c)/(e*(q + 1)), Int[(d + e*x)^(q + 1)/(1 + c^2*x^2), x], x] /; FreeQ[{
a, b, c, d, e, q}, x] && NeQ[q, -1]

Rule 627

Int[((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)^(m + p)*(a/d + (c*x)/e)^
p, x] /; FreeQ[{a, c, d, e, m, p}, x] && EqQ[c*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && I
ntegerQ[m + p]))

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 4884

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTan[c*x])^(p +
 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rubi steps

\begin{align*} \int \frac{\left (a+b \tan ^{-1}(c x)\right )^2}{(d+i c d x)^2} \, dx &=\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{c d^2 (1+i c x)}-\frac{(2 i b) \int \left (-\frac{a+b \tan ^{-1}(c x)}{2 d (-i+c x)^2}+\frac{a+b \tan ^{-1}(c x)}{2 d \left (1+c^2 x^2\right )}\right ) \, dx}{d}\\ &=\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{c d^2 (1+i c x)}+\frac{(i b) \int \frac{a+b \tan ^{-1}(c x)}{(-i+c x)^2} \, dx}{d^2}-\frac{(i b) \int \frac{a+b \tan ^{-1}(c x)}{1+c^2 x^2} \, dx}{d^2}\\ &=\frac{i b \left (a+b \tan ^{-1}(c x)\right )}{c d^2 (i-c x)}-\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d^2}+\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{c d^2 (1+i c x)}+\frac{\left (i b^2\right ) \int \frac{1}{(-i+c x) \left (1+c^2 x^2\right )} \, dx}{d^2}\\ &=\frac{i b \left (a+b \tan ^{-1}(c x)\right )}{c d^2 (i-c x)}-\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d^2}+\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{c d^2 (1+i c x)}+\frac{\left (i b^2\right ) \int \frac{1}{(-i+c x)^2 (i+c x)} \, dx}{d^2}\\ &=\frac{i b \left (a+b \tan ^{-1}(c x)\right )}{c d^2 (i-c x)}-\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d^2}+\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{c d^2 (1+i c x)}+\frac{\left (i b^2\right ) \int \left (-\frac{i}{2 (-i+c x)^2}+\frac{i}{2 \left (1+c^2 x^2\right )}\right ) \, dx}{d^2}\\ &=\frac{b^2}{2 c d^2 (i-c x)}+\frac{i b \left (a+b \tan ^{-1}(c x)\right )}{c d^2 (i-c x)}-\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d^2}+\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{c d^2 (1+i c x)}-\frac{b^2 \int \frac{1}{1+c^2 x^2} \, dx}{2 d^2}\\ &=\frac{b^2}{2 c d^2 (i-c x)}-\frac{b^2 \tan ^{-1}(c x)}{2 c d^2}+\frac{i b \left (a+b \tan ^{-1}(c x)\right )}{c d^2 (i-c x)}-\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d^2}+\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{c d^2 (1+i c x)}\\ \end{align*}

Mathematica [A]  time = 0.174562, size = 72, normalized size = 0.59 \[ -\frac{-2 a^2+b (b+2 i a) (c x+i) \tan ^{-1}(c x)+2 i a b+b^2 (-1+i c x) \tan ^{-1}(c x)^2+b^2}{2 c d^2 (c x-i)} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*ArcTan[c*x])^2/(d + I*c*d*x)^2,x]

[Out]

-(-2*a^2 + (2*I)*a*b + b^2 + b*((2*I)*a + b)*(I + c*x)*ArcTan[c*x] + b^2*(-1 + I*c*x)*ArcTan[c*x]^2)/(2*c*d^2*
(-I + c*x))

________________________________________________________________________________________

Maple [B]  time = 0.073, size = 344, normalized size = 2.8 \begin{align*}{\frac{i{a}^{2}}{c{d}^{2} \left ( 1+icx \right ) }}+{\frac{i{b}^{2} \left ( \arctan \left ( cx \right ) \right ) ^{2}}{c{d}^{2} \left ( 1+icx \right ) }}-{\frac{{b}^{2}\arctan \left ( cx \right ) \ln \left ( cx-i \right ) }{2\,c{d}^{2}}}-{\frac{i{b}^{2}\arctan \left ( cx \right ) }{c{d}^{2} \left ( cx-i \right ) }}+{\frac{{b}^{2}\arctan \left ( cx \right ) \ln \left ( cx+i \right ) }{2\,c{d}^{2}}}+{\frac{{\frac{i}{4}}{b}^{2}\ln \left ( cx-i \right ) \ln \left ( -{\frac{i}{2}} \left ( cx+i \right ) \right ) }{c{d}^{2}}}-{\frac{{\frac{i}{8}}{b}^{2} \left ( \ln \left ( cx-i \right ) \right ) ^{2}}{c{d}^{2}}}-{\frac{{b}^{2}}{2\,c{d}^{2} \left ( cx-i \right ) }}-{\frac{{b}^{2}\arctan \left ( cx \right ) }{2\,c{d}^{2}}}-{\frac{{\frac{i}{4}}{b}^{2}\ln \left ( -{\frac{i}{2}} \left ( -cx+i \right ) \right ) \ln \left ( -{\frac{i}{2}} \left ( cx+i \right ) \right ) }{c{d}^{2}}}+{\frac{{\frac{i}{4}}{b}^{2}\ln \left ( -{\frac{i}{2}} \left ( -cx+i \right ) \right ) \ln \left ( cx+i \right ) }{c{d}^{2}}}-{\frac{{\frac{i}{8}}{b}^{2} \left ( \ln \left ( cx+i \right ) \right ) ^{2}}{c{d}^{2}}}+{\frac{2\,iab\arctan \left ( cx \right ) }{c{d}^{2} \left ( 1+icx \right ) }}-{\frac{iab\arctan \left ( cx \right ) }{c{d}^{2}}}-{\frac{iab}{c{d}^{2} \left ( cx-i \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*arctan(c*x))^2/(d+I*c*d*x)^2,x)

[Out]

I/c*a^2/d^2/(1+I*c*x)+I/c*b^2/d^2/(1+I*c*x)*arctan(c*x)^2-1/2/c*b^2/d^2*arctan(c*x)*ln(c*x-I)-I/c*b^2/d^2*arct
an(c*x)/(c*x-I)+1/2/c*b^2/d^2*arctan(c*x)*ln(c*x+I)+1/4*I/c*b^2/d^2*ln(c*x-I)*ln(-1/2*I*(c*x+I))-1/8*I/c*b^2/d
^2*ln(c*x-I)^2-1/2/c*b^2/d^2/(c*x-I)-1/2*b^2*arctan(c*x)/c/d^2-1/4*I/c*b^2/d^2*ln(-1/2*I*(-c*x+I))*ln(-1/2*I*(
c*x+I))+1/4*I/c*b^2/d^2*ln(-1/2*I*(-c*x+I))*ln(c*x+I)-1/8*I/c*b^2/d^2*ln(c*x+I)^2+2*I/c*a*b/d^2/(1+I*c*x)*arct
an(c*x)-I/c*a*b/d^2*arctan(c*x)-I/c*a*b/d^2/(c*x-I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arctan(c*x))^2/(d+I*c*d*x)^2,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 2.194, size = 231, normalized size = 1.89 \begin{align*} \frac{{\left (i \, b^{2} c x - b^{2}\right )} \log \left (-\frac{c x + i}{c x - i}\right )^{2} + 8 \, a^{2} - 8 i \, a b - 4 \, b^{2} +{\left (2 \,{\left (2 \, a b - i \, b^{2}\right )} c x + 4 i \, a b + 2 \, b^{2}\right )} \log \left (-\frac{c x + i}{c x - i}\right )}{8 \,{\left (c^{2} d^{2} x - i \, c d^{2}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arctan(c*x))^2/(d+I*c*d*x)^2,x, algorithm="fricas")

[Out]

1/8*((I*b^2*c*x - b^2)*log(-(c*x + I)/(c*x - I))^2 + 8*a^2 - 8*I*a*b - 4*b^2 + (2*(2*a*b - I*b^2)*c*x + 4*I*a*
b + 2*b^2)*log(-(c*x + I)/(c*x - I)))/(c^2*d^2*x - I*c*d^2)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*atan(c*x))**2/(d+I*c*d*x)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.16505, size = 405, normalized size = 3.32 \begin{align*} \frac{\frac{2 \, b^{2} d i^{2} \arctan \left (\frac{{\left (c d i x + d\right )}{\left (\frac{d i^{2}}{c d i x + d} + 1\right )} i}{d}\right )}{c d i x + d} - b^{2} i \arctan \left (\frac{{\left (c d i x + d\right )}{\left (\frac{d i^{2}}{c d i x + d} + 1\right )} i}{d}\right )^{2} + \frac{2 \, b^{2} d i \arctan \left (\frac{{\left (c d i x + d\right )}{\left (\frac{d i^{2}}{c d i x + d} + 1\right )} i}{d}\right )^{2}}{c d i x + d} - \frac{2 \, a b d i^{2}}{c d i x + d} + 2 \, a b i \arctan \left (\frac{{\left (c d i x + d\right )}{\left (\frac{d i^{2}}{c d i x + d} + 1\right )} i}{d}\right ) - \frac{4 \, a b d i \arctan \left (\frac{{\left (c d i x + d\right )}{\left (\frac{d i^{2}}{c d i x + d} + 1\right )} i}{d}\right )}{c d i x + d} + \frac{2 \, a^{2} d i}{c d i x + d} - \frac{b^{2} d i}{c d i x + d} + b^{2} \arctan \left (\frac{{\left (c d i x + d\right )}{\left (\frac{d i^{2}}{c d i x + d} + 1\right )} i}{d}\right )}{2 \, c d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arctan(c*x))^2/(d+I*c*d*x)^2,x, algorithm="giac")

[Out]

1/2*(2*b^2*d*i^2*arctan((c*d*i*x + d)*(d*i^2/(c*d*i*x + d) + 1)*i/d)/(c*d*i*x + d) - b^2*i*arctan((c*d*i*x + d
)*(d*i^2/(c*d*i*x + d) + 1)*i/d)^2 + 2*b^2*d*i*arctan((c*d*i*x + d)*(d*i^2/(c*d*i*x + d) + 1)*i/d)^2/(c*d*i*x
+ d) - 2*a*b*d*i^2/(c*d*i*x + d) + 2*a*b*i*arctan((c*d*i*x + d)*(d*i^2/(c*d*i*x + d) + 1)*i/d) - 4*a*b*d*i*arc
tan((c*d*i*x + d)*(d*i^2/(c*d*i*x + d) + 1)*i/d)/(c*d*i*x + d) + 2*a^2*d*i/(c*d*i*x + d) - b^2*d*i/(c*d*i*x +
d) + b^2*arctan((c*d*i*x + d)*(d*i^2/(c*d*i*x + d) + 1)*i/d))/(c*d^2)